Subject: Re: BorderTop/BorderBottom etc..
From: [email-masked] (Simon Gris)
Date: 09 Jun 94 17:04:46 +0200
Newsgroups: comp.sys.amiga.programmer

In a message of 08 Jun 94 Terence Tan wrote to All:

 TT> @MSGID: 2:320/104.1 EEAD8EE8
 TT> @REPLYADDR [email-masked]
 TT> @PID: AmiGate 0.17 (7.6.94)

 TT> From: [email-masked] (Terence Tan)

 TT> Quick questions:
 TT> 1. What is the best way to findout the inner width/height of a window
 TT>    (Currently I use [Where pWdw is a struct Window  pointer]
 TT>     pWdw->Width - pWdw->BorderLeft - pWdw->BorderRight or
 TT>     pWdw->Height - pWdw->BorderTop - pWdw->BorderBottom). It doesn't
 TT>     seem to do it properly cause I usually have to adjust it by 1 -2
 TT>     pixels.

The best way is :
InnerWidth = pWdw->GZZWidth;
InnerHeight = pWdw->GZZHeight;

/* And this work even if the window is not a GZZWindow type */

 TT> 2. Does pWdw->BorderTop take into account the drag bar at the top?
 TT>    Is it font sensitive?

No ! You have to do the following :

OffY = pWdw->BorderTop + pWdw->WScreen->Font->ta_YSize + 1;
OffY = pWdw->BorderRight;

 TT> 3. Best way to clear a window?[BltClear??]

/* This fill yor entire Window's RastPort. In a normal window this destroy
** the system imagery on it. Wis a GZZWindow this is great.
*/
SetRast( pWdw->RastPort );

/* Or if it is not a GZZ : */
EraseRect( pWdw->RastPort, OffX, OffY,
           pWdw->GZZWidth + OffX - 1,
           pWdw->GZZHeight + OffY - 1 );

/* or */
SetRast( pWdw->RastPort );   /* Followed by : */
RefreshWindowFrame( pWdw );

Simon Gris  FIDO 2:320/104.39  EMAIL: [email-masked]
                                      [email-masked]

... Contents may have settled during shipping.